package com.rgp.apidriver.controller;

import com.rgp.apidriver.service.VerificationCodeService;
import com.rgp.internalcommon.dto.ResponseResult;
import com.rgp.internalcommon.dto.VerificationCodeDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author nhp
 * @version 1.0
 * @description TODO
 * @date 2024-04-17 19:25
 */
@RestController
public class VerificationCodeController {

    @Autowired
    private VerificationCodeService verificationCodeService;

    @PostMapping("check-verification-code")
    public ResponseResult checkVerificationCode(@RequestBody VerificationCodeDto verificationCodeDto){
        return verificationCodeService.checkVerificationCode(verificationCodeDto);
    }

    @GetMapping("auth-token")
    public ResponseResult authToken(@RequestHeader("Authorization") String token){
        System.out.println("token:" + token);
        return ResponseResult.success();
    }

    @GetMapping("no-auth-token")
    public ResponseResult noAuthToken(@RequestHeader("Authorization") String token){
        System.out.println("token:" + token);
        return ResponseResult.fail();
    }
}